package com.java2007.dao;

import com.java2007.pojo.Food;
import com.java2007.pojo.FoodType;

import java.sql.SQLException;
import java.util.List;

/**
 * 数据交互层
 * @author ZOU
 */
public interface FoodDao {
    /**
     * 查询全部
     * @return
     * @throws SQLException
     */
    List<Food> selectAll() throws SQLException;

    /**
     * 根据名字查询
     * @param foodName
     * @return
     * @throws SQLException
     */
    List<Food> findByFoodName(String foodName) throws SQLException;

    /**
     * 根据ID删除
     * @param foodId
     * @return
     * @throws SQLException
     */
    int deleteByFoodId(int foodId) throws SQLException;

    /**
     * 修改
     * @param food
     * @return
     * @throws SQLException
     */
    int saveFood(Food food)throws SQLException;

    /**
     * 通过ID查询
     * @param foodId
     * @return
     * @throws SQLException
     */
    Food findByFoodId(int foodId)throws SQLException;

    /**
     * 更新
     * @param food
     * @return
     * @throws SQLException
     */
    int updataFood(Food food)throws SQLException;

    /**
     * 当前页
     * @param pageNo
     * @param size
     * @param food
     * @return
     */
    List<Food> selectByPage(Integer pageNo, Integer size, Food food)throws SQLException;

    /**
     * 总页数
     * @param food
     * @return
     */
    Long selectFoodCount(Food food)throws SQLException;
}
